<?php
namespace Admin\Controller;
use Think\Controller;
class RoleController extends BaseController {
	//权限列表
	function index(){
		
		$this -> _list('role');
	}
	
	// 编辑、添加权限
	public function edit(){
		if(IS_POST){
			$_POST['date'] = time();
			if (empty($_POST['role_area'])){
				$this->error("请选择对应权限");
			}
			if (empty($_POST['name'])){
				$this->error("请填写角色名称");
			}
			$_POST['role_area'] = implode(',', $_POST['role_area']);
		}
		$this -> _edit('role', U('index'));
	}
	
}

?>